﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" ValidateRequest="false"
    CodeFile="EditPage.aspx.cs" Inherits="Admin_EditPage" %>

<%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="cc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script type="text/javascript">
        function dosub(){
            editor = top.document.getElementById(editorId);
            editor.value = richeditor.toHtmlString();
            
        }     
</script>
    <div id="categorytree" runat="server" class="tree">
        <asp:DropDownList runat="server" ID="ddlLanguageChoose" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguageChoose_SelectedIndexChanged">
            <asp:ListItem Text="Русский" Value="1"></asp:ListItem>
            <asp:ListItem Text="עברית" Value="2"></asp:ListItem>
        </asp:DropDownList>
        <asp:ListView ID="lvwFixedPages" runat="server" ItemPlaceholderID="plhFixedPages">
            <LayoutTemplate>
                <ul>
                    <asp:PlaceHolder ID="plhFixedPages" runat="server"></asp:PlaceHolder>
                </ul>
            </LayoutTemplate>
            <ItemTemplate>
                <li class="page">
                    <asp:HyperLink ID="hplEditPage" runat="server" NavigateUrl='<%#string.Format("~/Admin/EditPage.aspx?id={0}", Eval("pageId")) %>'><%#Eval("PageTitle")%></asp:HyperLink></li>
            </ItemTemplate>
        </asp:ListView>
    </div>
    <div id="content" runat="server">
        <h2>
            Редактировать страницу</h2>
        <h3 runat="server" id="updated" visible="false" class="highlight">
            Данные успешно сохранены.</h3>
        <fieldset>
            <div>
                <asp:HiddenField runat="server" ID="hfID" />
                <h3>
                    <%=sPageTitle %></h3>
            </div>
            <div runat="server" id="divContent">
            <div>
                <asp:Label runat="server" AssociatedControlID="txtPageSummary">Заголовок статьи:</asp:Label>
                <asp:TextBox ID="txtPageSummary" runat="server" TextMode="SingleLine" Columns="80"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPageSummary" runat="server" ControlToValidate="txtPageSummary"
                    Text="&#9679;" ErrorMessage="יש להזין תקציר" Display="Dynamic"></asp:RequiredFieldValidator>
            </div>
            <div>
                <asp:Label runat="server" AssociatedControlID="Rte1">Содержание</asp:Label>
               <%-- <FCKeditorV2:FCKeditor runat="server" ID="fckPageContent" BasePath="~/fckeditor/"
                    Width="60%" EnableViewState="true" Height="300px" ToolbarSet="ArticleBasic">
                </FCKeditorV2:FCKeditor>--%>
                <cc1:RichTextEditor ID="Rte1" Theme="Blue" runat="server" EnableViewState="true" />  
            </div>
            </div>
            <div id="thumbnail" runat="server">
                <img runat="server" id="imgPreview" style="width: 588px; height: 100px;" />
                <br />
                <asp:Label runat="server" AssociatedControlID="uplImage">Изменить картинку:</asp:Label>
                <ajax:AsyncFileUpload runat="server" ID="uplImage" Width="400px" CompleteBackColor="White"
                    UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" OnUploadedComplete="uplImage_UploadedComplete" />
                <asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/loading.gif" />
            </div>
            <br />
            <asp:ValidationSummary ID="vsSummary" runat="server" CssClass="error" DisplayMode="List" />
            <asp:Button ID="btnSave" runat="server" Text="Сохранить" OnClick="btnSave_Click" OnClientClick="CopyText()" />
        </fieldset>
    </div>
</asp:Content>
